	      	 function printLineViz(){
	      		if(dataViz.getNumberOfColumns()==1)
	      			return;
	            var options = {
	                    title: 'Promedios de Notas del ITBA',
	                    hAxis: {title: 'Fecha', viewWindow:{min: new Date(minViewYear,0,1), max: new Date(maxViewYear, 0, 1)}, viewWindowMode: 'explicit'},
	                    vAxis: {title: 'Nota', viewWindow:{min: min_avg, max: max_avg}, viewWindowMode: 'explicit'},
	                    legend: 'true',
	                    interpolateNulls: 'true'
	                  };
	            
	            annotatedtimeline = new google.visualization.LineChart(document.getElementById('chart_div'));
	            google.visualization.events.addListener(annotatedtimeline, 'select', selectDataFromChart);
	            annotatedtimeline.draw(dataViz, options);
	        }  
	       
	      	function initLineVisualization() {
	        	dataViz = new google.visualization.DataTable();
	        	dataViz.addColumn('date', 'Cuatrimestre');
	        	
				var i = 0;
				dataViz.addRows(cantRows());
				for(year = minYear; year < maxYear; year ++){
					for(month = 0; month < 12; month ++){
						dataViz.setCell(i, 0, new Date(year, month, 1));
						i++;
					}
				}
		        var allGrades = document.getElementById("all_grades");
		        if(allGrades.checked){
		        	addAllGradesInLine();
		        }
		        var minGrade = document.getElementById("min_grade");
		        if(minGrade.checked){
		        	addMinGradeInLine();
		        }
		    }
	      	
	      	function addMinGradeInLine() {
				minGradeCol = dataViz.addColumn('number', 'Min aprobacion');
	      		for(cuat = 0; cuat < dataViz.getNumberOfRows(); cuat++){
					dataViz.setCell(cuat, minGradeCol, 4);   
				} 	        
	        }

	      	function addAllGradesInLine() {
				allGradesCol = dataViz.addColumn('number', 'Promedio General');
				for(cuat = 0; cuat < dataViz.getNumberOfRows(); cuat++){
					var average = getGeneralAverage(dataViz.getValue(cuat, 0));
					if(validGrade(average))
      						dataViz.setCell(cuat, allGradesCol, average);   
				} 	        
	        }
	      	
	        function addCareerToLineViz(i) {
				var index = dataViz.addColumn('number', grouped_Career.getValue(i,0));
				for(cuat = 0; cuat < dataViz.getNumberOfRows(); cuat++){
					var average = getCareerAverage(grouped_Career.getValue(i,0), dataViz.getValue(cuat, 0));
					if(validGrade(average))
      						dataViz.setCell(cuat, index, average);   
				} 	        
	        }
	         
	        
	        function addAlumniToLineViz(i) {
				var index = dataViz.addColumn('number', grouped_alumni.getValue(i,0));
				for(cuat = 0; cuat < dataViz.getNumberOfRows(); cuat++){
					var average = getAlumniAverage(grouped_alumni.getValue(i,0), dataViz.getValue(cuat, 0));
					if(validGrade(average))
      						dataViz.setCell(cuat, index, average);   
				} 	           
	        }
	        
	        
	        function addSubjectToLineViz(i) {
				var index = dataViz.addColumn('number', grouped_subjects.getValue(i,0)); 
				for(month = 0; month < dataViz.getNumberOfRows(); month++){
					var average = getSubjectAverage(grouped_subjects.getValue(i,0), dataViz.getValue(month, 0));
					if(validGrade(average))
      						dataViz.setCell(month, index, average);   
				} 	            
	        }
	                
	        
	        
	        function getCareerAverage(career, date){
	        	var total = 0;
	        	var cant = 0;
				for (var i = 0; i < career_subject.getNumberOfRows(); i++) {
 					if((career_subject.getValue(i, 1) == career)){					
					for (var j = 0; j < grades.getNumberOfRows(); j++) {					
						if((grades.getValue(j, 2) == career_subject.getValue(i, 0)) && sameMonth(date, grades.getValue(j, 3))){
							total = total + grades.getValue(j, 4);
							cant++;
						}
						
					}
				}
						
				}
				if(cant > 0)
					return total/cant;
				return -1;
	        }
	        
	        function getGeneralAverage(date){
	        	var total = 0;
	        	var cant = 0;
				for (var i = 0; i < grades.getNumberOfRows(); i++) {					
					if(sameMonth(date, grades.getValue(i, 3))){
						total = total + grades.getValue(i, 4);
						cant++;
					}
						
				}
				if(cant > 0)
					return total/cant;
				return -1;
	        }
	        
	        function getSubjectAverage(subject, date){
	        	var total = 0;
	        	var cant = 0;
				for (var i = 0; i < grades.getNumberOfRows(); i++) {					
					if((grades.getValue(i, 2) == subject) && sameMonth(date, grades.getValue(i, 3))){
						total = total + grades.getValue(i, 4);
						cant++;
					}
						
				}
				if(cant > 0)
					return total/cant;
				return -1;
	        }
	        
	        function getAlumniGeneralAverage(alumni){
	        	var total = 0;
	        	var cant = 0;
				for (var i = 0; i < alumni_grade.getNumberOfRows(); i++) {
					if(alumni_grade.getValue(i, 5) == alumni){
						total = total + alumni_grade.getValue(i, 4);
						cant++;
					}						
				}
				if(cant > 0)
					return total/cant;
				return -1;
	        }
	        
	        function getAlumniAverage(alumni, date){
	        	var total = 0;
	        	var cant = 0;
				for (var i = 0; i < alumni_grade.getNumberOfRows(); i++) {
					if((alumni_grade.getValue(i, 5) == alumni) && sameMonth(date, alumni_grade.getValue(i, 3))){
						total = total + alumni_grade.getValue(i, 4);
						cant++;
					}
						
				}
				if(cant > 0)
					return total/cant;
				return -1;
	        }
	        
